<?php
/**
 * Created by PhpStorm.
 * User: 烬萌丶
 * Date: 2021/9/5
 * Time: 19:20
 */
$Task = $_GET['TaskId'] ?? '';

// 从数据库删除 $classId 的班级
$dsn = "sqlsrv:Server=LAPTOP-GQ4AGRUA\SQLEXPRESS;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "delete from Task where TaskId='{$Task}'";
$result = $db->exec($sql);

if ($result) {
    echo '删除成功，前往<a href="list.php">列表页</a>';
} else {
    echo '删除失败';
}